<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<%@ include file="/commons/commonEdit.jsp"%>
<%@ include file="/commons/validation.jsp"%>
<%@ include file="/commons/dateTime.jsp" %>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>出入证发放</title>
<script type="text/javascript" src="${ctx }/scripts/public3.js"></script>
<script type="text/javascript" src="${ctx}/scripts/public.js"></script>
<script type="text/javascript" src="${ctx}/scripts/common/prototype.js"></script>
<script type="text/javascript" src="${ctx}/scripts/common.js"></script>
<script language="JavaScript"  src="${ctx}/scripts/div/common.js"></script>
<script type="text/javascript" src="${ctx}/scripts/ajaxException.js"></script>

<script type="text/javascript">

	var licenceId ="${licenceId}";
	var passId = "";
	var ACTION_URL = "${ctx}/renovation_certificateAction.do?";

	function openPassAdd(){ //打开出入证申请页面

		var url = ACTION_URL+"method=navigateAddPass&licenceId="+licenceId;
   		top.windowOpen(url, "passAdd", "出入证申请", 420, 550,true,"passAddIfm");
	}

	function checkPassEdit(){ //检查是否可以进行修改
		if (passId == ""){
			Alert("请选择一条数据！");
			return ;
		}
		var url = ACTION_URL+"method=checkEditPass";
		new Ajax.Request(url,
			         { method:'post',
					   parameters:{passId:passId},
					   onComplete:checkEditReturn
					 });
	}
	function checkEditReturn(response){	//打开修改出入证页面

		var msg = response.responseText;
		if (msg != "true"){
			Alert(msg);
			return ;
		}

		var url = ACTION_URL+"method=navigateEditPass&passId="+passId;
   		top.windowOpen(url, "passEdit", "修改装修申请", 420, 550,true,"passEdit" );
	}

	function checkPassDelete(){ //检查是否可以进行删除
		if (passId == ""){
			Alert("请选择一条数据！");
			return ;
		}
		var url = ACTION_URL+"method=checkDeletePass";
		new Ajax.Request(url,
			         { method:'post',
					   parameters:{passId:passId},
					   onComplete:checkDeleteReturn
					 });
	}
	function checkDeleteReturn(response){	//确定删除询问

		var msg = response.responseText;
		if (msg != "true"){
			Alert(msg);
			return ;
		}

		AskConfirm("确定要删除这条记录吗？","proceduresRenovationFrm", ACTION_URL+"method=deletePass&passId="+passId);
	}


	function refreshList(){	//刷新出入证列表
		var url =ACTION_URL+"method=navigatePassList&licenceId="+licenceId;
		document.getElementById("passList").src = url;
	}

	function closeWin(){
		findFrame("main").refleshLiceneceFrame(); //刷新出入证列表页面
		windowClose();
	}

	function init(){
		this.licenceId = $('licenceId').value;
	}
</script>


</head>


<body onload="init();">
<form action="" id="myform" name="myform" method="post"></form>

<input id="licenceId" name="licenceId" type="hidden" value="${licenceId }" >
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
	    <td class="window_head_outBg">
	    <table border="0" cellpadding="0" cellspacing="0">
	      <tr>
	        <td><img src="${ctx}/images/ico_Advance.gif" width="16" height="16" align="absmiddle" /> <span class="window_head_intext">出入证发证</span></td>
	      </tr>
	    </table>
	    </td>
  </tr>
  <tr><td class="aux_header_line_1"></td></tr>
  <tr><td class="aux_header_line_2"></td></tr>
  <tr>
    <td class="content">

	<table width="100%" border="0" cellspacing="0" cellpadding="0" >
      <tr>
        <td class="aux_outtable_color"><table width="100%" border="0" cellpadding="0" cellspacing="1" class="aux_intable_color">
            <tr>
              <td class="aux_intable_td1">房 号：</td>
              <td class="aux_intable_td2">${licenceVO.houseNumber}</td>
              <td class="aux_intable_td1">许可证号：</td>
              <td class="aux_intable_td2">${licenceVO.licenceNumber }</td>
            </tr>
            <tr>
              <td class="aux_intable_td1">业主姓名：</td>
              <td class="aux_intable_td2">${licenceVO.clientNames }</td>
              <td class="aux_intable_td1">装修期限：</td>
              <td class="aux_intable_td2">从&nbsp;
            	<fmt:formatDate pattern='yyyy-MM-dd' value='${licenceVO.beginDate}'/>&nbsp;到&nbsp;
            	<fmt:formatDate pattern='yyyy-MM-dd' value='${licenceVO.endDate}'/></td>
			  </tr>

			  <tr>
			  	  <td colspan="4" class="aux_intable_td1">
				  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="tab_line">
	                      <tr>
	                         <td valign="top">
	                         <table width="100%" border="0" cellspacing="0" cellpadding="0" >
	                             <tr>
	                                <td class="bg_toolBar">
	                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
	                                    <tr>
	                                      <td width="35%" align="right"><table border="0" cellpadding="0" cellspacing="0" id="ico1">
	                                          <tr>
	                                            <td class="toolbarico"><a href="#" id="open"  onclick="openPassAdd();" onfocus="this.blur()"><img src="${ctx}/images/ico_newfile.gif" border="0" align="absbottom" alt="新建"/>&nbsp;</a></td>
	                                            <td class="toolbarico"><a href="#"  onClick="checkPassEdit();" onFocus="this.blur()"><img src="${ctx}/images/ico_amend.gif" alt="修改" width="16" height="16" border="0" align="absbottom" /></a></td>
	                                            <td class="toolbarico"><a href="#"  onClick="checkPassDelete();" onFocus="this.blur()"><img src="${ctx}/images/ico_delete.gif" alt="删除" width="16" height="16" border="0" align="absbottom" /></a></td>
	                                            <td  class="toolbarico">&nbsp;</td>
	                                          </tr>
	                                      </table></td>
	                                    </tr>
	                                </table>
	                                </td>
	                             </tr>
	                             <tr>
	                               <td colspan="5" >
									<iframe id="passList"  name="passList"  height="300px" frameborder="0" border="0"
											src="${ctx}/renovation_certificateAction.do?method=navigatePassList&licenceId=${licenceId}" width="100%" ></iframe>
	                               </td>
	                             </tr>
	                         </table>
	                         </td>
	                      </tr>
	              </table>
	              </td>
	  		</tr>
      </table>
      </td>
      </tr>
    </table>

	</td>
  </tr>


  <tr>
    <td class="window_footer">
    <table border="0" cellpadding="0" cellspacing="0">
        <tr>
        	<td class="btn_between_space"></td>
        	<td>
        	<table border="0" cellpadding="0" cellspacing="0" onClick="closeWin();">
	            <tr>
	              <td class="buttonOffLeft" id="btn1_31"></td>
	              <td class="buttonOffMiddle" id="btn1_32" onblur="btn_change(3)" onMouseOver="btn_change_over(3)" onMouseOut="btn_change_out(3)"><img src="${ctx}/images/ico_cancel.gif" border="0" align="absmiddle" /> 关 闭</td>
	              <td class="buttonOffRight" id="btn1_33"></td>
	            </tr>
        	</table>
        	</td>
         </tr>
    </table>
    </td>
  </tr>
</table>

</body>
</html>





















